package com.greenDao.activity.tool.button.movie;

import android.content.Intent;
import android.view.View;

import com.greenDao.activity.check.CheckMovieActivity.MovieSectionFragment;
import com.greenDao.activity.modify.ModifyMovieActivity;
import com.greenDao.pojo.Movie;

public class ModifyMovieButton implements View.OnClickListener {

	private final MovieSectionFragment movieSectionFragment;
	private final Movie movie;

	public ModifyMovieButton(MovieSectionFragment movieSectionFragment, Movie movie) {
		this.movieSectionFragment = movieSectionFragment;
		this.movie = movie;
	}

	@Override
	public void onClick(View view) {
		Intent intent = new Intent(movieSectionFragment.getActivity(), ModifyMovieActivity.class);
		intent.putExtra("id", movie.getId());
		intent.putExtra("title", movie.getTitle());
		intent.putExtra("director", movie.getDirector());
		intent.putExtra("year", movie.getYear());
		intent.putExtra("rate", movie.getRate());
		movieSectionFragment.startActivity(intent);
	}
}
